﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using Blog.Types.Repository;

namespace Blog.DbRepository
{
    partial class Message : IMessage
    {
        public IMessageTree GetMessageTree()
        {
            return MessageTree;
        }

        public override string ToString()
        {
            return MessageText;
        }
    }

    partial class Theme : ITheme
    {
        public override string ToString()
        {
            return ThemeHeader;
        }
    }

    partial class MessageTree : IMessageTree
    {
        public ReadOnlyCollection<IMessage> GetMessages()
        {
            return Messages.OfType<IMessage>().ToList().AsReadOnly();
        }

        public ITheme GetTheme()
        {
            return Theme;
        }
    }

}
